package com.shirley.netty.udp.client;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.DatagramChannel;
import io.netty.handler.codec.DatagramPacketDecoder;
import io.netty.handler.codec.DatagramPacketEncoder;
import io.netty.handler.codec.protobuf.ProtobufEncoder;
import io.netty.handler.codec.string.StringDecoder;

public class UdpClientChannelInit extends ChannelInitializer<DatagramChannel> {


    @Override
    protected void initChannel(DatagramChannel ch) throws Exception {
        ch.pipeline()
                .addLast(new DatagramPacketDecoder(new StringDecoder()))
                .addLast(new UdpClientInputMsgHandler());
    }
}
